package com.ityedao.方法引用.构造器引用;

public class Test {
    public static void main(String[] args) {
//        CreateCar cc = new CreateCar() {
//            @Override
//            public Car create(String name, double price) {
//                return new Car(name, price);
//            }
//        };

//        CreateCar cc = (name, price) ->  new Car(name, price);

        // 构造器引用
        CreateCar cc = Car::new;
        Car c = cc.create("奔驰", 49.9);
        System.out.println(c);
    }
}

